#include<bits/stdc++.h>
using namespace std;
long long n;
long long arr[10000];
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	long long num1=0;
	long long num2=0;
	int temp;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>temp;
		if(temp==1) num1++;
		else if(temp==2) num2++;
		}
		if(num1>=num2) cout<<n-num2;
		if(num1<num2) cout<<n-num1;
	return 0;
}

